
//import org.mybatis.generator.api.MyBatisGenerator;
//import org.mybatis.generator.api.ShellRunner;
//import org.mybatis.generator.config.Configuration;
//import org.mybatis.generator.config.xml.ConfigurationParser;
//import org.mybatis.generator.internal.DefaultShellCallback;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhuxiaomeng
 * @date 2017/12/4.
 * @email 154040976@qq.com
 */
public class MybatisApp {

  public static void main(String[] args) {
//    args = new String[] { "-configfile", "sword-web\\src\\main\\resources\\auto-config\\mybatis-config.xml", "-overwrite" };
//    ShellRunner.main(args);

    System.out.println(Runtime.getRuntime().availableProcessors());
  }
//@Test
  public void testGenerateMyBatis3WithInvalidConfig() throws Exception {
//    List<String> warnings = new ArrayList<String>();
//    ConfigurationParser cp = new ConfigurationParser(warnings);
//    //System.out.println(this.getClass().getResourceAsStream("/auto-config/mybatis-config.xml").available());
//    Configuration config = cp.parseConfiguration(this.getClass().getResourceAsStream("/auto-config/mybatis-config.xml"));
//
//    DefaultShellCallback shellCallback = new DefaultShellCallback(true);
//
//    try {
//      MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, shellCallback, warnings);
//      myBatisGenerator.generate(null);
//      //myBatisGenerator.generate(null);
//    } catch (Exception e) {
//      e.printStackTrace();
//    }
  }

}
